Vue.directive("preload", function(el,binding){
    // console.log("asdasd")

    el.src = "";
    let temp = el.style.cssText;
    // console.log(temp)

    el.style.objectFit = "scale-down";
    el.style.objectPosition = "center";

    let img = document.createElement("img");
    img.src = binding.value;
    
    img.onload = function(){
        el.src = binding.value;
        el.style = temp;
    }
})